package com.group3.pojo.result;/**
 * LeaveOperationRecordReceive
 *
 * @author HY
 * 2021/07/12 16:37
 **/


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;

/**
 * ClassName LeaveOperationRecordReceive
 * Description
 * @author 余久
 * @Date 2021/07/12 16:37
 **/

@Data
public class LeaveOperationRecordResult {
    private Integer id;

    private Integer leaveId;

    private String reasonsFailure;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
    private Date operationTime;

    private Integer type;

    private String teacherName;

    private String studentName;

    private String nameStr;

    public String getNameStr() {
        if (this.type != null){
//            0：提交申请，1：通过申请，2：未通过申请，3：重新提交
            switch (this.type) {
                case 0: return studentName;
                case 1: return teacherName;
                case 2: return teacherName;
                case 3: return studentName;
            }
        }
        return "/";
    }
}
